
var str1=""//买家昵称
var str2=""//地址
var str3=""//备注
var str4=""//买家电话
var str5=""//类型
/*展开所有列表*/
Array.from(document.getElementsByClassName("open-item-wrapper")).map(
 function(x){x.click()}
);

/*
修改位置
参数=1 只打印一条的数据
参数=2 全打印
*/

//延时器
setTimeout(function(){
    //1秒后执行刷新
    listfun(2);
}, 2000);


function listfun(type) {
		Array.from(document.getElementsByClassName("order-card-detail")).map(
			function (x){
				var arr2=x.getElementsByClassName("item-info")//一个行商品
				if(arr2.length==1/*只有一个商品的时候*/){
					em=x.getElementsByClassName('receive-info receive-info-detail')[0]
			        str1=str1+em.getElementsByClassName('people-info')[0].outerText.split(" ")[1]+"\n"//买家名称 自增
			        str2=str2+em.getElementsByClassName('receiver-address')[0].outerText+"\n"//地址 自增
			        str3=str3+em.getElementsByClassName('note-info')[0].outerText+em.parentElement.parentElement.getElementsByClassName('order-card-info')[0].innerText+"\n"//备注 自增
				      str4=str4+em.getElementsByClassName('people-info')[0].outerText.split(" ")[2]+"\n"//买家电话 自增

              eme2=x.getElementsByClassName("item-info")[0]
				      str5=str5+eme2.getElementsByClassName("item-sku")[0].innerText+"--"+eme2.getElementsByClassName("item-num")[0].getElementsByTagName("div")[1].innerText+"\n"

				    //x.parentElement.remove()/*打印完毕之后删除一条的数据*/
				 }else{
				 	 if(type==2){
					 	 bb=""
					 	 eme=x.getElementsByClassName("item-info")
					 	 Array.from(eme).map(
				           function(m){
				            bb=bb+m.getElementsByClassName("item-sku")[0].innerText+"--"+m.getElementsByClassName("item-num")[0].getElementsByTagName("div")[1].innerText+"==="
				           }
					 	 )
				        em=x.getElementsByClassName('receive-info receive-info-detail')[0]
				        str1=str1+em.getElementsByClassName('people-info')[0].outerText.split(" ")[1]+"\n"//买家名称 自增
				        str2=str2+em.getElementsByClassName('receiver-address')[0].outerText+"\n"//地址 自增
				        str3=str3+em.getElementsByClassName('note-info')[0].outerText+em.parentElement.parentElement.getElementsByClassName('order-card-info')[0].innerText+"\n"//备注 自增
					    str4=str4+em.getElementsByClassName('people-info')[0].outerText.split(" ")[2]+"\n"//买家电话 自增
					  	str5=str5+bb+"\n"
				 	 }else{
              str5=str5+"NULL!!!!!!!!!!!\n"

				 	 }
				}
			}
		);
	console.log(str1+"\n\n\n"+str4+"\n\n\n"+str2+"\n\n\n"+str3+"\n\n\n"+str5)
}
	// body...




